/**
 * @description 数据模型入口文件
 * @author 756370340
 */

const User = require('./User')
const { Dynamic,DynamicLike } = require('./Dynamic')
const Follow = require('./Follow')
const Notice = require('./Notice')
const Video = require('./Video')
const Type = require('./Type')

// User.hasMany(Dynamic,{
//     foreignKey: 'openId'
// })

Dynamic.belongsTo(User,{
    foreignKey: 'userId'
})

Notice.belongsTo(User,{
    foreignKey: 'userId'
})

// User.hasMany(Follow,{
//     foreignKey:'followId',
//     as:'followDetail'
// })

Follow.belongsTo(User,{
    foreignKey: 'followId'
})

// DynamicLike.belongsTo(Dynamic,{
//     foreignKey: 'dynamicId'
// })

Dynamic.hasMany(DynamicLike,{//关联
    foreignKey:'dynamicId'
})


module.exports = {
    User,
    Dynamic,
    Follow,
    Notice,
    DynamicLike,
    Video,
    Type
}